def resolution1():
    count = 0
    count_all = 0
    first = 0
    while True:
        line = input()

        if line == '.':
            break
        count_all += 1

        if line.find("chi1 huo3 guo1") != -1:
            if count == 0:
                first = count_all
            count += 1

    # output
    print(count_all)
    if count == 0:
        print("-_-#")
    else:
        print(f"{first} {count}")


if __name__ == '__main__':
    resolution1()